<?php

/**
 * 管理员管理
 * @author Kevin_ren  <330202207@qq.com>
 */

namespace Admin\Controller;

use Common\Controller\BaseManageController;

class AdminController extends BaseManageController
{

    /**
     * 管理员列表
     * @author Kevin_ren  <330202207@qq.com>
     */
    public function index()
    {
        $Model = D("Admin");

        $data = $this->lists($Model);

        foreach ($data as $k => $val) {
            $data[$k] = $Model->_format($val);
        }
        $this->assign('list', $data);
        $this->display();
    }

    public function _before_add()
    {
        $this->assign('roles', D('Role')->getAllData());
    }

    public function _before_edit()
    {
        $this->_before_add();
    }

}
